/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.store;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.C575;
import queenb.web.util.PackageContants;

/**
 *
 * @author Nguyen Hung
 */
public class C575Store extends C575 {

    public List<C575> ccurpks_listoftabc575(int pnFH000, int pnFH200, int pnFC475, int pcFIDS, int pnFV050, String pvLOGIN) {
        try {
            DataStatement data = new DataStatement(PackageContants.ccurpks_listoftabc575, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFC475),
                        new Param(OracleTypes.INTEGER, pcFIDS),
                        new Param(OracleTypes.INTEGER, pnFV050),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.find(data, C575.class);
        } catch (SQLException ex) {
            Logger.getLogger(C575Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(C575Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(C575Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    public int stdc_tools_inserttabc575(int pnPC575, int pnFH000, int pnFV500, int pnFC425, int pnFC475, int pnFN100, int pnFIDS, String pvCV576, String pvCV577, int pnCN578, String pvCV579, String pvCV580, String pvCV581, String pvCV582, String pvCV583, String pvCV584, Date pdCD585, Date pdCD586, Date pdCD587, int pnCN588, int pnCN589, int pnCN590, String pvLOGIN) {
        DataStatement dataStetament = new DataStatement(PackageContants.stdc_tools_inserttabc575, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPC575),
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFV500),
                    new Param(OracleTypes.INTEGER, pnFC425),
                    new Param(OracleTypes.INTEGER, pnFC475),
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.INTEGER, pnFIDS),
                    new Param(OracleTypes.CHAR, pvCV576),
                    new Param(OracleTypes.CHAR, pvCV577),
                    new Param(OracleTypes.INTEGER, pnCN578),
                    new Param(OracleTypes.CHAR, pvCV579),
                    new Param(OracleTypes.CHAR, pvCV580),
                    new Param(OracleTypes.CHAR, pvCV581),
                    new Param(OracleTypes.CHAR, pvCV582),
                    new Param(OracleTypes.CHAR, pvCV583),
                    new Param(OracleTypes.CHAR, pvCV584),
                    new Param(OracleTypes.DATE, pdCD585),
                    new Param(OracleTypes.DATE, pdCD586),
                    new Param(OracleTypes.DATE, pdCD587),
                    new Param(OracleTypes.INTEGER, pnCN588),
                    new Param(OracleTypes.INTEGER, pnCN589),
                    new Param(OracleTypes.INTEGER, pnCN590),
                    new Param(OracleTypes.CHAR, pvLOGIN),});
        try {
            return super.update(dataStetament, C575.class);
        } catch (SQLException ex) {
            Logger.getLogger(C575Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    public int stdc_tools_stornotabc575(int pnPC575, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.stdc_tools_stornotabc575, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPC575),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.update(dataStatement, C575.class);
        } catch (SQLException ex) {
            Logger.getLogger(C575Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }
//     public List<C575> findAllC575ForCombo(int pnFH000, int pnFH200, int pnPC575,String pvKV303, String pvLOGIN) {
//        try {
//            DataStatement dataStatement = new DataStatement(PackageContants.COMBO_C575N, OracleTypes.CURSOR, new Param[]{
//                        new Param(OracleTypes.INTEGER, pnFH000),
//                        new Param(OracleTypes.INTEGER, pnFH200),
//                        new Param(OracleTypes.INTEGER, pnPC575),
//                         new Param(OracleTypes.CHAR, pvKV303),
//                        new Param(OracleTypes.CHAR, pvLOGIN)
//                    });
//            return super.find(dataStatement, C575.class);
//        } catch (SQLException ex) {
//            Logger.getLogger(C575Store.class.getName()).log(Level.SEVERE, null, ex);
//            return null;
//        } catch (InstantiationException ex) {
//            Logger.getLogger(C575Store.class.getName()).log(Level.SEVERE, null, ex);
//            return null;
//        } catch (IllegalAccessException ex) {
//            Logger.getLogger(C575Store.class.getName()).log(Level.SEVERE, null, ex);
//            return null;
//        }
//    }

    public int updateC575(int pnPC575, String pvCV579, String pvCV580, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.stdc_tools_updatetabc575, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPC575),
                        new Param(OracleTypes.CHAR, pvCV579),
                        new Param(OracleTypes.CHAR, pvCV580),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.update(dataStatement, C575.class);
        } catch (SQLException ex) {
            Logger.getLogger(C575Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }
}
